TuPerfil.net uses Supabase for the PostgreSQL database, authentication, and file storage. Follow these steps to create a new project and prepare it for the application.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/santiagodc8/tu_perfil.net/llms.txt
Use this file to discover all available pages before exploring further.
Create a Supabase account
Go to supabase.com and sign up or log in. The free tier is sufficient for development and small production deployments.
Create a new project
From the Supabase dashboard, click New project and fill in:
- Name — e.g.
tuperfil-net - Database password — choose a strong password and save it somewhere safe; you will not need it day-to-day, but you may need it to connect via direct Postgres tooling
- Region — choose the region closest to your users (e.g. South America for an Argentine audience)
Run the initial schema migration
Open SQL Editor in the left sidebar, click New query, paste the full contents of
supabase/migrations/001_initial_schema.sql, and click Run.This migration creates the core schema:categoriestable with the six default news categoriesarticlestable with RLS policies (public read for published articles, authenticated write)contactstable (public insert, authenticated read)article-imagesstorage bucket with public read and authenticated write policiesupdate_updated_at()trigger function
After running migration 001, continue running migrations 002 through 019 in order. See the Migrations page for the full list and instructions.
Get your API keys
Go to Settings → API in the Supabase dashboard. You need three values:
Copy these into your
| Key | Field in dashboard | Variable name |
|---|---|---|
| Project URL | Project URL | NEXT_PUBLIC_SUPABASE_URL |
| Anon key | Project API keys → anon public | NEXT_PUBLIC_SUPABASE_ANON_KEY |
| Service role key | Project API keys → service_role secret | SUPABASE_SERVICE_ROLE_KEY |
.env.local file. See Environment variables for details.Create the first admin user
Go to Authentication → Users → Add user → Create new user. Enter an email address and a secure password.This is the account you will use to log in at
/admin.If you have already run migration
012_user_roles.sql, the first user created automatically receives the admin role. Subsequent users receive the editor role. You can change roles directly in the profiles table via the Table Editor.(Optional) Run seed data
If you want sample articles to test the public site, open the SQL Editor, paste the contents of
supabase/seed.sql, and run it.The seed script automatically uses the first user in auth.users as the author, so it works without any manual substitution. It creates one published article in each of the six categories:| Category | Article |
|---|---|
| Perfil Político | Government economic measures |
| Perfil Judicial | Historic corruption ruling |
| Perfil Salud | Record vaccination campaign |
| Perfil Deportivo | Local team reaches national final |
| Perfil Regional | New water treatment plant |
| Perfil Internacional | Climate summit historic agreements |
Row Level Security
RLS is enabled on every table in the schema. You do not need to configure it manually — the migrations set up the correct policies. The key rules are:| Table | Anonymous (unauthenticated) | Authenticated |
|---|---|---|
articles | Read published, non-deleted articles | Full CRUD |
categories | Read all | Full CRUD |
contacts | Insert only | Read, update, delete |
comments | Insert; read approved only | Full CRUD |
subscribers | Insert (subscribe) | Read, update, delete |
ads | Read active ads | Full CRUD |
breaking_news | Read all | Insert, update |
page_views | Insert | Read |
ad_events | Insert | Read |
